﻿using FluentNHibernate.Mapping;
using IapService.Entity;

namespace IapService.Mappings
{
    public class VectorMap : ClassMap<Vector>
    {
        public VectorMap()
        {
            Not.LazyLoad();

            Id(x => x.Id);
            Map(x => x.Name);

            HasMany(x => x.VectorImages)
                .Inverse()
                .Not.LazyLoad()
                .KeyColumn("vectorId")
                .AsBag()
                ;
            HasMany(x => x.VectorTags)
                .Inverse()
                .Not.LazyLoad()
                .KeyColumn("vectorId")
                .AsBag()
                ;
        }
    }
}